package com.zoop.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zoop.dao.UserDao;
import com.zoop.entity.User;
import com.zoop.service.UserService;
import com.zoop.source.DynamicDataSourceHolder;

@Service
public class UserServiceImpl implements UserService{

	@Autowired
	private UserDao userDao;
	
	public List<User> list() {
		DynamicDataSourceHolder.setDataSource("dataSource1");
		return userDao.list();
	}

	public List<User> list2() {
		DynamicDataSourceHolder.setDataSource("dataSource2");
		return userDao.list();
	}

}
